home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ML_VECTB.ZIP / UTILS / MKFORM5.PAS < prev    next >
Pascal/Delphi Source File  |  1996-03-10  |  1KB  |  58 lines

  1. uses dosio;
  2. var
  3.   coord:array[0..60] of record x,y,z:integer end;
  4.   max:word;
  5.   f:file;
  6.  
  7. Procedure BuildForm;
  8. var a:integer;
  9. begin
  10.   max:=0;
  11.   for a:=0 to 7 do begin
  12.     with coord[max] do begin
  13.       x:=-50+trunc(a*100/8);
  14.       z:=-50;
  15.       y:=50;
  16.     end;
  17.     inc(max);
  18.     with coord[max] do begin
  19.       x:=-50+trunc((a+1)*100/16);
  20.       z:=-50+trunc((a+1)*100/8);
  21.       y:=50;
  22.     end;
  23.     inc(max);
  24.     with coord[max] do begin
  25.       x:=trunc((a+1)*100/16);
  26.       z:=50-trunc((a+1)*100/8);
  27.       y:=50;
  28.     end;
  29.     inc(max);
  30.     with coord[max] do begin
  31.       x:=-50+trunc(a*100/8);
  32.       z:=50;
  33.       y:=-50;
  34.     end;
  35.     inc(max);
  36.     with coord[max] do begin
  37.       x:=-50+trunc((a+1)*100/16);
  38.       z:=50-trunc((a+1)*100/8);
  39.       y:=-50;
  40.     end;
  41.     inc(max);
  42.     with coord[max] do begin
  43.       x:=trunc((a+1)*100/16);
  44.       z:=-50+trunc((a+1)*100/8);
  45.       y:=-50;
  46.     end;
  47.     inc(max);
  48.   end;
  49. end;
  50.  
  51. begin
  52.   Writeln('Making figure ...');
  53.   openforoutput(f,'_triangl.bal','');
  54.   BuildForm;
  55.   blockwrite(f,max,2);  { Nr of points in the 3D form }
  56.   blockwrite(f,coord,max*3*2);
  57.   closefile(f,'');
  58. end.